﻿#region Using directives

using System;
using System.Collections;
using System.Data;
using UFSoft.UBF.UI.MD.Runtime;
using UFSoft.UBF.UI.MD.Runtime.Implement;

#endregion

namespace PRChangeDoc
{
	[Serializable]
	public partial class PRChangeDocModel : UIModel
	{
		#region Constructor
		public PRChangeDocModel() : base("PRChangeDoc")
		{
			InitClass();
			this.SetResourceInfo("9475f52a-376c-4900-9455-9f918f8c0d83");
            try{
			    AfterInitModel();
            }catch(Exception exception){
              IUIModel model = this;
		      this.ErrorMessage.SetErrorMessage(ref model,exception);
			}
		}

		//just for Clone 
		private PRChangeDocModel(bool isInit) : base("PRChangeDoc")
		{}
		protected override IUIModel CreateCloneInstance()
		{
			return new PRChangeDocModel(false);
		}
		#endregion
		#region member
		#region views
		private cRefView viewcRef;			
		#endregion
		
		#region links
		#endregion
		
		#region properties
		#endregion
		#endregion

		#region property
		public cRefView cRef
		{
			get { return (cRefView)this["cRef"]; }
		}
		
		#region RealViews
		#endregion
		
	
		#endregion

		#region function
		private void InitClass()
		{
			this.viewcRef = new cRefView(this);
			this.viewcRef.SetResourceInfo("e5c92aa0-ceb0-48fe-af98-180d730a18e3");
			this.Views.Add(this.viewcRef);			

			
		}

		public override string AssemblyName
		{
			get { return "UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDUI"; }
		}
		
		#endregion
		private void OnValidate_DefualtImpl()
    {
    }

	}


	[Serializable]
	public partial class cRefView : UIView
	{
		#region Constructor
		public cRefView(IUIModel model) : base(model,"cRef","UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDBE.PRChangeBE.PRChangeDoc", true)
		{
			InitClass();
		}
		//构造空实例,不进行初始化.目前为Clone使用.
		private cRefView():base(null,"cRef","UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDBE.PRChangeBE.PRChangeDoc", true)
		{
		}
		protected override IUIView CreateCloneInstance()
		{
			return new cRefView();
		}
		#endregion

		#region fiels property filter
		public IUIField FieldID
		{
			get { return this.Fields["ID"]; }
		}
		public IUIField FieldCreatedOn
		{
			get { return this.Fields["CreatedOn"]; }
		}
		public IUIField FieldDocNo
		{
			get { return this.Fields["DocNo"]; }
		}
		public IUIField FieldBusinessDate
		{
			get { return this.Fields["BusinessDate"]; }
		}
		public IUIField FieldStatus
		{
			get { return this.Fields["Status"]; }
		}
		public IUIField FieldPRDocNo
		{
			get { return this.Fields["PRDocNo"]; }
		}


		[Obsolete("请使用CurrentFilter属性，这个方法有可能会导致强弱类型转换出错")]
		public cRefDefaultFilterFilter DefaultFilter
		{
			get { return (cRefDefaultFilterFilter)this.CurrentFilter; }
		}
		#endregion

		#region Init
		private void InitClass()
		{
			UIModelRuntimeFactory.AddNewUIField(this,"ID", typeof(Int64), false,"","System.Int64", "ID", true,true, false, "",false,(UIFieldType)1,"ba391065-6c27-4c82-acc8-b52b1c93a910","c12ef5ea-0954-4d47-a20c-b8c7bed56b0d");
			UIModelRuntimeFactory.AddNewUIField(this,"CreatedOn", typeof(DateTime), true,"","System.DateTime", "CreatedOn", true,true, false, "",false,(UIFieldType)1,"3834a958-120f-4ac9-8d60-1a7be6d3f12f","60807318-b436-46e8-9bd3-ccaafbe2ff7f");
			UIModelRuntimeFactory.AddNewUIField(this,"DocNo", typeof(String), false,"","System.String", "DocNo", true,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","fa943a4e-e7b8-4a77-ba81-d997729b61e6");
			UIModelRuntimeFactory.AddNewUIField(this,"BusinessDate", typeof(DateTime), false,"","System.Date", "BusinessDate", true,true, false, "",false,(UIFieldType)1,"c9e6bc50-2e39-4f27-9519-da0c7859d37e","f7d488da-c99b-4bc0-bd90-ad7600bd5834");
			UIModelRuntimeFactory.AddNewUIField(this,"Status", typeof(Int32), true,"","UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDBE.PRChangeBE.PRChangeDocStatusEnum", "Status", true,true, false, "",false,(UIFieldType)2,"6baa9999-501b-4115-90d5-7091ef6b32f9","29e52f10-ffdb-4b63-92cc-0320be610682");
			UIModelRuntimeFactory.AddNewUIField(this,"PRDocNo", typeof(String), true,"","System.String", "PRDocNo", true,true, false, "",false,(UIFieldType)1,"3d174255-fd12-47f7-8844-3b5e4fae9e8c","bec34b38-7ee2-489f-a9eb-ed2d85547ca4");


			this.CurrentFilter = new cRefDefaultFilterFilter(this);
		}
		#endregion
		
		#region override method
		protected override IUIRecord BuildNewRecord(IUIRecordBuilder builder)
		{
			return new cRefRecord(builder);
		}
		#endregion

		#region new method
		public new cRefRecord FocusedRecord
		{
			get { return (cRefRecord)base.FocusedRecord ; }
			set { base.FocusedRecord = value ; }
		}
		public new cRefRecord AddNewUIRecord()
		{	
			return (cRefRecord)base.AddNewUIRecord();
		}
		public new cRefRecord NewUIRecord()
		{	
			return (cRefRecord)base.NewUIRecord();
		}
		#endregion 

	}

	[Serializable]
	public class cRefRecord : UIRecord
	{
		#region Constructor
		public cRefRecord(IUIRecordBuilder builder):base(builder)
		{
		}
		private cRefView uiviewcRef
		{
			get { return (cRefView)this.ContainerView; }
		}
		protected override IUIRecord CreateCloneInstance(IUIRecordBuilder builder)
		{
			return new cRefRecord(builder);
		}
		#endregion

		#region property
		
		
		public  Int64 ID
		{
			get{
				//object value = this[this.uiviewcRef.FieldID] ;
				//return (Int64)value;
				return GetValue<Int64>(this.uiviewcRef.FieldID);
			}
			set{
				this[this.uiviewcRef.FieldID] = value;
			}
		}
		
		
		public  DateTime? CreatedOn
		{
			get{
				//object value = this[this.uiviewcRef.FieldCreatedOn] ;
				//return (DateTime?)value;
				return GetValue<DateTime?>(this.uiviewcRef.FieldCreatedOn);
			}
			set{
				this[this.uiviewcRef.FieldCreatedOn] = value;
			}
		}
		
		
		public  String DocNo
		{
			get{
				//object value = this[this.uiviewcRef.FieldDocNo] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldDocNo);
			}
			set{
				this[this.uiviewcRef.FieldDocNo] = value;
			}
		}
		
		
		public  DateTime BusinessDate
		{
			get{
				//object value = this[this.uiviewcRef.FieldBusinessDate] ;
				//return (DateTime)value;
				return GetValue<DateTime>(this.uiviewcRef.FieldBusinessDate);
			}
			set{
				this[this.uiviewcRef.FieldBusinessDate] = value;
			}
		}
		
		
		public  Int32? Status
		{
			get{
				//object value = this[this.uiviewcRef.FieldStatus] ;
				//return (Int32?)value;
				return GetValue<Int32?>(this.uiviewcRef.FieldStatus);
			}
			set{
				this[this.uiviewcRef.FieldStatus] = value;
			}
		}
		
		
		public  String PRDocNo
		{
			get{
				//object value = this[this.uiviewcRef.FieldPRDocNo] ;
				//return (String)value;
				return GetValue<String>(this.uiviewcRef.FieldPRDocNo);
			}
			set{
				this[this.uiviewcRef.FieldPRDocNo] = value;
			}
		}
		#endregion
	}
	
	[Serializable]
	public class cRefDefaultFilterFilter : UIFilter
	{
		#region Constructor
		public cRefDefaultFilterFilter(IUIView view) 
			: base("DefaultFilter",view,@"",@"")
		{
			InitClass();
		}
		//for Clone Constructor
		private cRefDefaultFilterFilter()
			: base("DefaultFilter",null,"","")
		{}
		protected override IUIFilter CreateCloneInstance()
		{
			return new cRefDefaultFilterFilter();
		}
		#endregion

		#region property
		#endregion
		
		#region function
		private void InitClass()
		{
		}
		#endregion

	}



}